<HTML><HEAD><TITLE>concat_atom(++List, -Dest)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Strings and Atoms</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>concat_atom(++List, -Dest)</H1>
Succeeds if Dest is the concatenation of the atomic terms contained in List.
It is more efficient to use concat_string/2 whenever possible.


<DL>
<DT><EM>List</EM></DT>
<DD>List of atomic terms.
</DD>
<DT><EM>Dest</EM></DT>
<DD>Atom or variable.
</DD>
</DL>
<H2>Description</H2>
   Dest is unified with the concatenation of the atomic terms contained in
   List.  List may contain numbers, atoms and strings.  The result of the
   concatenation is always an atom.

<P>
   The use of this predicate is discouraged in favour of concat_string/2,
   because the creation of new atoms involves entering them into a
   dictionary whose garbage collection is relatively expensive.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>concat_atom(++, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>List is not instantiated (non-coroutine mode only).
<DT><EM>(4) instantiation fault </EM>
<DD>List contains free variables (non-coroutine mode only).
<DT><EM>(5) type error </EM>
<DD>List is instantiated, but not to a list of atomic terms.
<DT><EM>(5) type error </EM>
<DD>Dest is neither an atom nor a variable.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      concat_atom([abc,def],abcdef).

      concat_atom(["Str1","Str2"],X).
                             X = 'Str1Str2'.

      concat_atom([the,man," is aged ",20],X).
                             X = 'theman is aged 20'.

      concat_atom([1,2,3],X)
                             X = '123'.

Fail:
      concat_atom([ab,bc],abc).

Error:
      concat_atom(A,X).        (Error 4).
      concat_atom([abc,D],X).  (Error 4).
      concat_atom(art,X).      (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/stratom/concat_string-2.html">concat_string / 2</A>, <A HREF="../../kernel/stratom/concat_atoms-3.html">concat_atoms / 3</A>, <A HREF="../../kernel/stratom/atom_string-2.html">atom_string / 2</A>, <A HREF="../../kernel/stratom/join_string-3.html">join_string / 3</A>
</BODY></HTML>
